package com.dao.manager.imp;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import com.dao.manager.DishDaoW;
import com.po.DishBeanW;

@Repository
public class DishDaoImpW implements DishDaoW {

	@Resource(name = "sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;
	@Override
	public List<DishBeanW> getDishListW(DishBeanW dish) {
		// TODO Auto-generated method stub
		List<DishBeanW> list = sqlSessionTemplate.selectList("getDishListW", dish);
		return list;
	}
	@Override
	public Integer getDishCountW(DishBeanW dish) {
		// TODO Auto-generated method stub
		Integer count = sqlSessionTemplate.selectOne("getDishCountW", dish);
		return count;
	}
	@Override
	public int updateDishW(DishBeanW dish) {
		// TODO Auto-generated method stub
		int result = sqlSessionTemplate.update("updateDishW", dish);
		return result;
	}
	@Override
	public int delDishListW(String[] dishid) {
		// TODO Auto-generated method stub
		int result = sqlSessionTemplate.delete("delDishListW", dishid);
		return result;
	}
	@Override
	public List<DishBeanW> getAdminByids(String[] array) {
		// TODO Auto-generated method stub
		List<DishBeanW> list = sqlSessionTemplate.selectList("getAdminByids",array);
		return list;
	}
	
}
